//计算rem值
const designWidth = 1920; //设计图宽度
const designRem = 1;//设计图中1rem的像素值

const setRem = () => {
    const deviceWidth = document.documentElement.clientWidth;
    const currentRem = (deviceWidth / designWidth) * designRem;
    document.documentElement.style.fontSize = currentRem + 'px';
};

export default setRem;